package com.flight.trans.adapter;


import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentPagerAdapter;


import com.flight.trans.base.BaseFragment;

import java.util.List;

/**
 *  @author : YanKing
 *  @date : 2019/5/9  9:30
 *  @Description : ViewPager内的Fragment切换的填充
 */

public class ViewPagerFragmentAdapter extends FragmentPagerAdapter {

    private List<BaseFragment> mFragments ;

    public ViewPagerFragmentAdapter(FragmentManager fragmentManager, List<BaseFragment> mFragments) {
        super(fragmentManager);
        this.mFragments = mFragments ;
    }

    @Override
    public int getCount() {
        return mFragments.size();
    }

    @Override
    public BaseFragment getItem(int arg0) {
        return mFragments.get(arg0);
    }
}